<template>
	<view class="outBox">
		<u-navbar leftText="购物车" leftIconColor="#fff" :autoBack="true" bgColor="#242331">
			<view class="left-slot" slot="left">
				 <u-icon name="arrow-left" color="#fff"></u-icon>
				<text>购物车</text>
			</view>
			<view class="left-slot" slot="right" :style="{
				marginRight:barWidth + 'px'
			}">
				<view class="clear">
					清空
				</view>
			</view>
		</u-navbar>
		<view class="content" :style="{
			marginTop:barHeight + 'px',
		}">
			<view class="items">
				<view class="item">
<!--					<image src="../../static/logo.png" mode=""></image>-->
					<view class="info">
						<view class="title">
							<text>玛格丽特</text>
						</view>
						<view class="price">
							<text>¥99.99</text>
							<view class="number">
								<u-number-box v-model="nummber">
									<view slot="minus" class="minus">
										<u-icon name="minus" size="12"></u-icon>
									</view>
									<text slot="input" style="width: 50px;text-align: center;"
										class="input">{{nummber}}</text>
									<view slot="plus" class="plus">
										<u-icon name="plus" size="12" color="#fff"></u-icon>
									</view>
								</u-number-box>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="textInfo">
				<view class="textItem">
					<view class="name">
						备注
					</view>
					<view class="value">
						<u--input placeholder="请输入" v-model="remark" @change="changeRemark" color="#fff"
							inputAlign="right"></u--input>
					</view>
				</view>
				<view class="textItem">
					<view class="name">
						桌号
					</view>
					<view class="value">
						30
					</view>
				</view>
			</view>
		</view>
		<view class="footer">
			<view class="price">
				<view class="name">
					支付金额：
				</view>
				<view class="value">
					¥99.99
				</view>
			</view>
			<view class="btn">
				提交订单
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getWXStatusHeight
	} from '@/utils/index.js'
	export default {
		data() {
			return {
				// 胶囊的宽度
				barWidth: 0,
				barHeight: 0,
				nummber: 1,
				remark: '', // 备注
			}
		},
		onLoad() {
			let obj = getWXStatusHeight()
			this.barWidth = obj.barWidth + 3
			this.barHeight = obj.barHeight + 51
		},
		methods: {
			changeRemark(e) {
				this.remark = e
			}
		}
	}
</script>

<style lang="scss" scoped>
	.footer {
		width: 100%;
		height: 140rpx;
		position: fixed;
		left: 0rpx;
		// bottom: calc(20rpx + env(safe-area-inset-bottom));
		bottom: 0rpx;
		background: #181a25;
		z-index: 9999;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 50rpx;
		box-sizing: border-box;
		.price{
			font-size: 36rpx;
			display: flex;
			.name{
				color: #CACACA;
			}
			.value{
				color: #66AA0B;
				font-size: 40rpx;
			}
		}
		.btn{
			padding: 20rpx 40rpx;
			background-color: #66AA0B;
			border-radius: 40rpx;
			color: #fff;
		}
	}

	.textInfo {
		margin-top: 30rpx;

		.textItem {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 30rpx;
			padding-bottom: 20rpx;
			border-bottom: 1px solid #5B5E6F;

			.name {
				color: #8a898e;
				font-size: 36rpx;
			}

			.value {
				color: #fff;
			}
		}
	}

	.minus {
		width: 22px;
		height: 22px;
		border-width: 1px;
		border-color: #E6E6E6;
		border-style: solid;
		border-top-left-radius: 100px;
		border-top-right-radius: 100px;
		border-bottom-left-radius: 100px;
		border-bottom-right-radius: 100px;
		@include flex;
		justify-content: center;
		align-items: center;
	}

	.input {
		padding: 0 10px;
	}

	.plus {
		width: 22px;
		height: 22px;
		background-color: #FF0000;
		border-radius: 50%;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		justify-content: center;
		align-items: center;
	}

	.items {
		.item {
			margin-bottom: 30rpx;
			background-color: #fff;
			border-radius: 20rpx;
			padding: 20rpx;
			display: flex;

			image {
				width: 160rpx;
				height: 160rpx;
				margin-right: 20rpx;
			}

			.info {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				padding: 10rpx 0;

				.title {
					font-size: 36rpx;
				}

				.price {
					color: #FE1A33;
					display: flex;
					justify-content: space-between;

					.number {
						color: #242331;
					}

					.add {
						width: 50rpx;
						height: 50rpx;
						border-radius: 50%;
						background-color: #FE1A33;
						display: flex;
						align-items: center;
						justify-content: center;
					}
				}
			}
		}
	}

	.clear {
		background-color: #79a140;
		color: #fff;
		padding: 10rpx 20rpx;
		border-radius: 10rpx;
	}

	.content {
		position: relative;
		padding: 20rpx 40rpx;
		box-sizing: border-box;
		min-height: calc(100vh - 40rpx);
	}

	.left-slot {
		color: #fff;

		image {
			width: 40rpx;
			margin-right: 30rpx;
		}
	}

	.outBox {
		background-color: #242331;
	}
</style>
